# --------------------------------
# -*- coding: utf-8 -*-
# Author: Zhu
# Time: 2021/12/15   
# Description:
# --------------------------------

import time
from Common.GetLog import GetLog
from PageLocators.page_suppliemanagement_loc import ele_SUPPLIE_MANAGEMENT as loc
from Common.Base import Base
log = GetLog.get_logger()


class fun_SUPPLIE_MANAGEMENT(Base):
    u'管理端-供应商管理元素使用'

    def m_Supplie_Menu(self):
        u'打开【供应商管理】页面'
        log.info("打开【供应商管理】页面")
        print("打开【供应商管理】页面")
        self.base_click(loc.ys_Supplie_suppliemanagement)
        time.sleep(1)

    def m_Create_Supplie(self):
        u'点击【新建】供应商按钮'
        log.info("点击【新建】供应商按钮")
        print("点击【新建】供应商按钮")
        self.base_click(loc.ys_Supplie_create)
        time.sleep(1)

    def m_Choose_Shipper(self):
        u'选择货主'
        log.info("新建-选择货主")
        print("新建-点击货主")
        self.base_click(loc.ys_Supplie_c_shippername)
        time.sleep(1)
        print("新建-选择货主--UI货主")
        self.base_click(loc.ys_Supplie_shippername)
        time.sleep(1)

    def m_Input_SupplieInfo(self, SupplieName, SupplieBM, SupplieContact, SupplieContactPhone, SuppliePhoneGH,
                                                        SupplieRemark,  SupplieAddress):
        u'输入新建供应商信息'

        log.info("输入供应商名称")
        print("输入供应商名称")
        self.base_input(loc.ys_Supplie_supplie_name, SupplieName)
        time.sleep(1)

        log.info("输入供应商编码")
        print("输入供应商编码")
        self.base_input(loc.ys_Supplie_bm, SupplieBM)
        time.sleep(1)

        log.info("输入联系人")
        print("输入联系人")
        self.base_input(loc.ys_Supplie_contact, SupplieContact)
        time.sleep(1)

        log.info("输入联系人手机")
        print("输入联系人手机")
        self.base_input(loc.ys_Supplie_contactphone, SupplieContactPhone)
        time.sleep(1)

        log.info("输入联系人固话")
        print("输入联系人固话")
        self.base_input(loc.ys_Supplie_phoneGH, SuppliePhoneGH)
        time.sleep(1)

        log.info("输入备注")
        print("输入备注")
        self.base_input(loc.ys_Supplie_remark, SupplieRemark)
        time.sleep(1)

        log.info("输入详细地址")
        print("输入详细地址")
        self.base_input(loc.ys_Supplie_address, SupplieAddress)
        time.sleep(1)

    def m_SupplieInfo_Submit(self):
        u'提交供应商信息新建按钮'
        log.info("提交供应商信息新建按钮")
        print("提交供应商信息新建按钮")
        self.base_click(loc.ys_Supplie_submit)
        time.sleep(1)




